Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the types explicit in quaternion_helper.hpp. #625

Merged
merged 1 commit into from
Nov 12, 2020

Conversation

clalancette
Copy link
Contributor

Windows started complaining that there was possible loss of
precision. That came about because we were using the 'double'
versions of cmath functions (sqrt, pow, etc). However, it
turns out that Ogre only deals with floats by default anyway
(and we don't change the default when we vendor it), so switch
all calculations to floats.

Signed-off-by: Chris Lalancette clalancette@openrobotics.org

This should fix the last warning we are currently getting from Windows, as seen in https://ci.ros2.org/view/nightly/job/nightly_win_rel/1750/ (as one example).

Windows started complaining that there was possible loss of
precision.  That came about because we were using the 'double'
versions of cmath functions (sqrt, pow, etc).  However, it
turns out that Ogre only deals with floats by default anyway
(and we don't change the default when we vendor it), so switch
all calculations to floats.

Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
@clalancette
Copy link
Contributor Author

CI:

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

@mjeronimo
Copy link
Contributor

Just a question for my own info... What does "we don't change the default when we vendor it" mean? What does it mean "to vendor" something?

@clalancette
Copy link
Contributor Author

clalancette commented Nov 12, 2020

Just a question for my own info... What does "we don't change the default when we vendor it" mean? What does it mean "to vendor" something?

Vendoring in general means that we are building a library/utility that isn't a core part of ROS 2. We vendor a number of libraries in ROS 2: Ogre, spdlog, libyaml, etc. The reasons for doing that vary, but often revolve around the library shipped by default in Linux being too old (spdlog is one example of that), or the library not being available in a convenient way in Windows or macOS.

In this case, we are vendoring Ogre here in the RViz package: https://github.com/ros2/rviz/tree/ros2/rviz_ogre_vendor . By default, Ogre uses float for everything. It is possible to override this when building it, but we don't in the vendored package. So by switching everything to float, we keep to the type that Ogre is using.

@mjeronimo
Copy link
Contributor

@clalancette Thanks for the explanation.

@clalancette
Copy link
Contributor Author

All right, CI is green all around, and I have approvals. Merging this with the hope that we get closer to green on Windows overnight.

@clalancette clalancette merged commit 23bb367 into ros2 Nov 12, 2020
@clalancette clalancette deleted the clalancette/quaternion-type-fix branch November 12, 2020 18:30
chapulina pushed a commit that referenced this pull request Apr 20, 2021
Windows started complaining that there was possible loss of
precision.  That came about because we were using the 'double'
versions of cmath functions (sqrt, pow, etc).  However, it
turns out that Ogre only deals with floats by default anyway
(and we don't change the default when we vendor it), so switch
all calculations to floats.

Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
chapulina added a commit that referenced this pull request Apr 21, 2021
Windows started complaining that there was possible loss of
precision.  That came about because we were using the 'double'
versions of cmath functions (sqrt, pow, etc).  However, it
turns out that Ogre only deals with floats by default anyway
(and we don't change the default when we vendor it), so switch
all calculations to floats.

Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>

Co-authored-by: Chris Lalancette <clalancette@openrobotics.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants